package models

import (
	"time"
	"vip_video/internal"
)

type VideoChapterModel struct {
	Id        int64      `json:"id" db:"id"`
	VideoId   int64      `json:"video_id" db:"video_id"`
	ChannelId int64      `json:"channel_id" db:"channel_id"`
	Title     string     `json:"title" db:"title"`
	Thumb     string     `json:"thumb" db:"thumb"`
	Url       string     `json:"url" db:"url"`
	Creator   string     `json:"creator" db:"creator"`
	CreatedAt time.Time  `json:"created_at" db:"created_at"`
	Updater   *string    `json:"updater" db:"updater"`
	UpdatedAt *time.Time `json:"updated_at" db:"updated_at"`
}

func (vcm *VideoChapterModel) FullThumb() *VideoChapterModel {
	vcm.Thumb = internal.ParseStaticUrl(vcm.Thumb)
	return vcm
}
